package com.yjd.comm.tag.service;

import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.enums.ReferenceTypeEnum;
import com.yjd.comm.tag.model.TagRelevanceModel;

import java.util.List;

/**
 * <b>description</b>：标签关联业务接口<br>
 * <b>time</b>：2017-06-27 08:58:34 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
public interface ITagRelevanceService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public TagRelevanceModel insert(TagRelevanceModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(TagRelevanceModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception;

	/**
	 * 批量新增
	 * @param list
	 * @throws Exception
	 */
	public void batchInsert(List<TagRelevanceModel> list,Long prj_id)throws Exception;

	/**
	 * 创建/更新tag的关联
	 *
	 * 将tags与ref_type类型的ref_id关联起来
	 *
	 * Created by yangchangyan on 2017/7/19.
	 * 
	 * @param 
	 * @return 
	 * @throws 
	 */
	public void updateTagRelevance(String[] tags, Long ref_id, ReferenceTypeEnum ref_type) throws Exception;
}
